<html>
<body>
Reports usages of <code>instanceof</code> or <code>getClass() == SomeClass.class</code> in which a
<code>this</code> expression is checked.
<p>Such expressions indicate a failure of the object-oriented design, and should be replaced by
  polymorphic constructions.</p>
<p>Example:</p>
<pre><code>
class Super {
  void process() {
    if (this instanceof Sub) { // warning
      doSomething();
    } else {
      doSomethingElse();
    }
  }
}
  
class Sub extends Super {}
</code></pre>
<p>To fix the problem, use an overriding method:</p>
<pre><code>
class Super {
  void process() {
    doSomethingElse();
  }
}
  
class Sub extends Super {
  @Override
  void process() {
    doSomething();
  }
}  
</code></pre>
<!-- tooltip end -->
</body>
</html>